<extend name="Base/common"/>
<block name="header">
    <include file="Public/nav"/>
</block>

<block name="body">

<script type="text/javascript">
    if (document.getElementById('sub_nav') == null) {
        $('#main-container').css('margin-top', $('#nav_bar').height() + 15)
    }
</script>
<!--banner部分-->
<link href="__CSS__/oscloud.css" rel="stylesheet" type="text/css"/>

<form id="search_form" action="{:U('Appstore/index/search')}" method="get" style="display: none;">
    <input id="keywords_input" name="keywords" value="{$param.keywords}"/>
    <input id="entity_input" name="entity" value="{$param.entity}"/>
    <input id="order_input" name="order" value="{$param.order}"/>
    <input id="type_input" name="type" value="{$param.type}"/>
</form>
    <div class="common-block oscloud"style="padding-top: 20px" >
        <!--new  oscloud start-->
        <div class="container banner-top" >
            <div class="col-xs-12">
                <div class="col-xs-2 banner-top-left">
                    <a href="{:U('Appstore/Index/index')}"><img src="__IMG__/b-logo.png"/></a>
                </div>
                <div class="col-xs-7 banner-top-center">
                    <div style="width: 590px;float: right">
                        <input type="text" name="keywords" class="search" data-role="search" value="{$param.keywords}"
                               placeholder="在此输入您需要的插件、模块、主题、服务，功能暂时停用" style="padding-left: 10px;font-size: 16px"><a
                            class="search-btn" data-role="search-btn">搜索</a></div>
                    <div class="tips" style="margin-top: 5px">
                        <ul>
                            <li style="color: #b0b0b0">热门搜索：</li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_240.html">Restful接口</a></li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_52.html">手机网页版</a></li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_226.html">微信公众号</a></li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_53.html">问答</a></li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_264.html">Ping++充值</a></li>
                            <li><a href="http://os.opensns.cn/appstore/moduledetail_243.html">卡密充值</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!-- search result list-->
    <div class="container common-block templet">
        <section>

            <div class="row">

                <div class="col-xs-12">
                    <ul class="nav nav-secondary" style="margin-top: 10px">
                        <li class="entity_0"><a href="javascript:void(0);" data-role="entity" data-value="0">全部</a></li>
                        <li class="entity_1"><a href="javascript:void(0);" data-role="entity" data-value="1">插件</a></li>
                        <li class="entity_2"><a href="javascript:void(0);" data-role="entity" data-value="2">模块</a></li>
                        <li class="entity_3"><a href="javascript:void(0);" data-role="entity" data-value="3">主题</a></li>
                        <li class="entity_4"><a href="javascript:void(0);" data-role="entity" data-value="4">服务</a></li>
                    </ul>
                </div>
                <script>
                    $('.entity_'+'{$param.entity}').addClass('active');
                </script>
            </div>
            <div style="padding:10px">

            </div>
            <div class="up_search row">
                <div class="col-xs-9">
                    <ul class="nav nav-secondary">
                        <a class=" btn btn-default" data-role="order" data-value="update">最后更新
                            <eq name="param.order" value="update">从新到旧 ↓</eq></a>
                        <a class=" btn btn-default" data-role="order" data-value="create">最后发布
                            <eq name="param.order" value="create">从新到旧 ↓</eq></a>
                        <a class=" btn btn-default" data-role="order" data-value="sales">销量
                            <eq name="param.order" value="sales">从高到低 ↓</eq>
                        </a>
                        <a class="btn btn-default" data-role="order" data-value="watch">订阅量
                            <eq name="param.order" value="watch">从高到低 ↓</eq>
                        </a>
                    </ul>
                </div>
                <div class="col-xs-3 text-right">
                    <div class="nav nav-secondary" style="display: inline-block">
                        <li id="type_all" type="button">
                            <a data-role="type" data-value="all">全部</a>
                        </li>
                        <li id="type_free" type="button">
                            <a data-role="type" data-value="free">Free 免费</a>
                        </li>
                        <li id="type_notfree" type="button" class=" ">
                            <a data-role="type" data-value="notfree">付费</a>
                        </li>
                    </div>
                    <script>
                        $("#type_{$param.type}").addClass('active');
                    </script>
                </div>

                <!--搜素框-->
                <!--搜素框-->
            </div>

            <div class="clearfix"></div>

            <!-- 插件列表部分-->

            <empty name="lists.data">
                <div class="with-padding">
                    <div style="width: 50%;margin: auto">
                        <div class="alert  with-icon">
                            <i class="icon icon-frown"></i>

                            <div class="content">

                                <p style="font-size: 16px">没有符合条件的结果 ~……~</p>
                            </div>
                        </div>
                    </div>
                </div>

                <else/>

                <ul class="clearfix goods-list">
                    <volist name="lists.data" id="vo">
                        <switch name="vo.entity">
                            <case value="1">
                                <li style="">
                                    <div class="clearfix">
                                        <div style="width: 110px;float: left"><a
                                                href="{:U('pluginDetail',array('id'=>$vo['id']))}"
                                                class="app_icon"><b></b>
                                            {$vo.cover|display_cover}

                                        </a></div>
                                        <div class="col-xs-3" style="width:350px;">
                                            <h3 class="margin-top-0"><a href="{:U('pluginDetail',array('id'=>$vo['id']))}">{$vo.title}</a>
                                                {$vo.latest_version|display_version=true}
                                            </h3>

                                            <p class="ad text-muted">
                                                {$vo.ad|default='暂无商品介绍。'}</p>


                                            <p class="text-muted"> 服务商：
                                                {$vo.id|display_shop}
                                                <!-- 更新：{$vo.update_time|friendlyDate}    &nbsp;&nbsp;&nbsp;     发布：{$vo.create_time|friendlyDate}-->
                                            </p>
                                        </div>
                                        <div class="col-xs-3 " style="width: 300px;position: relative">
                                            &nbsp;
                                            <div class="price_area" style="">
                                                <div class="inner-content">{$vo.versions.0.id|display_fee_detail}</div>
                                            </div>
                                        </div>
                                        <div class="col-xs-4" style="width: 250px">
                                            <table class="text-center data-cols">
                                                <tr>
                                                    <td>销量<br/><span class="text-danger">{$vo.sales}</span></td>
                                                    <td>订阅<br/><span class="text-success">{$vo.watch_count}</span></td>
                                                    <td>下载<br/><span class="count">{$vo.total_download_count|display_download_times}</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>

                                </li>
                            </case>
                            <case value="2">
                                <li style="">
                                    <div class="clearfix">
                                        <div style="width: 110px;float: left"><a
                                                href="{:U('moduleDetail',array('id'=>$vo['id']))}"
                                                class="app_icon"><b></b>
                                            {$vo.cover|display_cover}

                                        </a></div>
                                        <div class="col-xs-3" style="width:350px;">
                                            <h3 class="margin-top-0"><a href="{:U('moduleDetail',array('id'=>$vo['id']))}">{$vo.title}</a>
                                                {$vo.latest_version|display_version=true}
                                            </h3>

                                            <p class="ad text-muted">
                                                {$vo.ad|default='暂无商品介绍。'}</p>


                                            <p class="text-muted"> 服务商：
                                                {$vo.id|display_shop}
                                                <!-- 更新：{$vo.update_time|friendlyDate}    &nbsp;&nbsp;&nbsp;     发布：{$vo.create_time|friendlyDate}-->
                                            </p>
                                        </div>
                                        <div class="col-xs-3 " style="width: 300px;position: relative">
                                            &nbsp;
                                            <div class="price_area" style="">
                                                <div class="inner-content">{$vo.versions.0.id|display_fee_detail}</div>
                                            </div>
                                        </div>
                                        <div class="col-xs-4" style="width: 250px">
                                            <table class="text-center data-cols">
                                                <tr>
                                                    <td>销量<br/><span class="text-danger">{$vo.sales}</span></td>
                                                    <td>订阅<br/><span class="text-success">{$vo.watch_count}</span></td>
                                                    <td>下载<br/><span class="count">{$vo.total_download_count|display_download_times}</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </li>
                            </case>
                            <case value="3">
                                <li style="">
                                    <div class="clearfix">
                                        <div style="width: 110px;float: left"><a
                                                href="{:U('themeDetail',array('id'=>$vo['id']))}"
                                                class="app_icon"><b></b>
                                            {$vo.cover|display_cover}

                                        </a></div>
                                        <div class="col-xs-3" style="width:350px;">
                                            <h3 class="margin-top-0"><a href="{:U('themeDetail',array('id'=>$vo['id']))}">{$vo.title}</a>
                                            </h3>

                                            <p class="ad text-muted">
                                                {$vo.ad|default='暂无商品介绍。'}</p>


                                            <p class="text-muted"> 服务商：
                                                {$vo.id|display_shop}

                                                <!-- 更新：{$vo.update_time|friendlyDate}    &nbsp;&nbsp;&nbsp;     发布：{$vo.create_time|friendlyDate}-->
                                            </p>
                                        </div>
                                        <div class="col-xs-3 " style="width: 300px;position: relative">
                                            &nbsp;
                                            <div class="price_area" style="">
                                                <div class="inner-content">{$vo.versions.0.id|display_fee_detail}</div>
                                            </div>
                                        </div>
                                        <div class="col-xs-4" style="width: 250px">
                                            <table class="text-center data-cols">
                                                <tr>
                                                    <td>销量<br/><span class="text-danger">{$vo.sales}</span></td>
                                                    <td>订阅<br/><span class="text-success">{$vo.watch_count}</span></td>
                                                    <td>下载<br/><span class="count">{$vo.total_download_count|display_download_times}</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>

                                </li>
                            </case>
                            <case value="4">
                                <li style="">
                                    <div class="clearfix">
                                        <div style="width: 110px;float: left"><a
                                                href="{:U('goodsDetail',array('id'=>$vo['id']))}"
                                                class="app_icon"><b></b>
                                            {$vo.cover|display_cover}

                                        </a></div>
                                        <div class="col-xs-3" style="width:350px;">
                                            <h3 class="margin-top-0"><a href="{:U('goodsDetail',array('id'=>$vo['id']))}">{$vo.title}</a>
                                            </h3>

                                            <p class="ad text-muted">
                                                {$vo.ad|default='暂无商品介绍。'}</p>


                                            <p class="text-muted"> 服务商：
                                                {$vo.id|display_shop}

                                                <!-- 更新：{$vo.update_time|friendlyDate}    &nbsp;&nbsp;&nbsp;     发布：{$vo.create_time|friendlyDate}-->
                                            </p>
                                        </div>
                                        <div class="col-xs-3 " style="width: 300px;position: relative">
                                            &nbsp;
                                            <div class="price_area" style="">
                                                <div class="inner-content">{$vo.versions.0.id|display_fee_detail}</div>
                                            </div>
                                        </div>
                                        <div class="col-xs-4" style="width: 250px">
                                            <table class="text-center data-cols">
                                                <tr>
                                                    <td>销量<br/><span class="text-danger">{$vo.sales}</span></td>
                                                    <td>订阅<br/><span class="text-success">{$vo.watch_count}</span></td>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>

                                </li>
                            </case>
                        </switch>


                    </volist>
                </ul>
            </empty>
            <!-- 插件列表部分-->
            <div class="pull-right"> {$lists.html}</div>
        </section>

        <script>
            $(function () {
                $('.goods-list >li').mouseenter(function () {
                    var $this = $(this).find('.price_area');
                    if ($this.children('.inner-content').height() > 100) {
                        $this.addClass('price-focus');
                        $this.css('top', (80 - $this.height()) / 2 + 'px');

                    }
                    $(this).addClass('li-focus')

                })
                $('.goods-list >li').mouseleave(function () {
                    var $this = $(this).find('.price_area');
                    $this.removeClass('price-focus');
                    $this.css('top', 0);
                    $(this).removeClass('li-focus')
                })
            })

            $(document).ready(function () {

                $("#count1").dayuwscroll({
                    parent_ele: '#wrapBox1',
                    list_btn: '#tabT04',
                    pre_btn: '#left1',
                    next_btn: '#right1',
                    path: 'left',
                    auto: true,
                    time: 3000,
                    num: 6,
                    gd_num: 6,
                    waite_time: 1000
                });

            });
        </script>
        <script src="__JS__/scroll.1.3.js">


        </script>
        <script src="__JS__/breakingnews.js">
            $(function () {
                $('#breakingnews1').BreakingNews({
                    title: '公告'
                });
            })

        </script>
    </div>

<script>
    $(function(){
        $('[data-role="search"]').keypress(function (e) {
            if (e.which == 13 || e.which == 10) {
                var keywords=$('[data-role="search"]').val();
                $('#keywords_input').val(keywords);
                submit_form();
            }
        });
       $('[data-role="search-btn"]').click(function(){
           var keywords=$('[data-role="search"]').val();
           $('#keywords_input').val(keywords);
           submit_form();
       });
        $('[data-role="entity"]').click(function(){
            var entity=$(this).attr('data-value');
            $('#entity_input').val(entity);
            submit_form();
        });
        $('[data-role="order"]').click(function(){
            var order=$(this).attr('data-value');
            $('#order_input').val(order);
            submit_form();
        });
        $('[data-role="type"]').click(function(){
            var type=$(this).attr('data-value');
            $('#type_input').val(type);
            submit_form();
        });
    });
    var submit_form=function(){
        var param=$('#search_form').serialize();
        var action=$('#search_form').attr('action');
        window.location=action+'&'+param;
    }
</script>
</block>